<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	
</script>
</head>
<body>
<table border="1" width="1000">
	<tr>
		<td colspan="8" align="right"><a href="#">添加学生</a></td>
	</tr>
	<tr>
		<td>编号</td>
		<td>姓名</td>
		<td>性别</td>
		<td>邮箱</td>
		<td>电话</td>
		<td>地址</td>
		<td>年龄</td>
		<td>操作</td>
	</tr>
	<c:forEach var="s" items="${page.list}">
		<tr>
			<td>${s.sid }</td>
			<td>${s.sname }</td>
			<td>${s.sex }</td>
			<td>${s.email }</td>
			<td>${s.telephone }</td>
			<td>${s.addr }</td>
			<td>${s.age }</td>
			<td><a href="${pageContext.request.contextPath}/StudentFindByIdServlet?sid=${s.sid }">编辑</a>|<a href="#" onclick="deleteStudent(${s.sid })">删除</a></td>
		</tr>
	</c:forEach>
	<tr>
		<td colspan="8">
			
			总${page.totalPage }页数|总${page.totalCount }条数&nbsp;&nbsp;
			<!-- 显示首页 和上一页 -->
			<c:if test="${page.currentPage==1}">
				<a href="#">首页</a>
			</c:if>&nbsp;
			<c:if test="${page.currentPage>1}">
				<a href="#?currentPage=${page.currentPage-1}">上一页</a>
			</c:if>&nbsp;
			<!-- 显示导航的页码数 -->
			<c:forEach var ="i" begin="1" end="${page.totalPage}">
				<!--如果i就和当前页一致,就不允许点击  -->
				 <c:if test="${page.currentPage==i}">
						[${i }]
				</c:if>&nbsp;
				<!-- 可以点击 -->
				<c:if test="${page.currentPage!=i}">
					<a href="${pageContext.request.contextPath}/page?currentPage=${i }">${i }</a>
				</c:if>&nbsp;
			</c:forEach>
			
			<!-- 显示第三部分 -->
			<c:if test="${page.currentPage<page.totalPage}">
				<a href="#">下一页</a>
			</c:if>&nbsp;
			<c:if test="${page.currentPage==page.totalPage}">
				<a href="#">尾页</a>
			</c:if>&nbsp;
		</td>
	</tr>
</table>
</body>
</html>